﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" auto-import="true" assembly="DataLayer" namespace="DataLayer.Entities">
  <class name="UserEntity" table="users" lazy="false">
    <id name="ID" column="id">
      <generator class="native" />
    </id>
    <property name="UserName" column="user_name" not-null="true"/>
    <property name="Password" column="password"/>

    <bag name="Logins" cascade="all" lazy="true">
      <key column="user_id"/>
      <one-to-many
         class="DataLayer.Entities.UserLoginEntity, NHibernateOneToMany"/>
    </bag>

    <bag name="Settings" cascade="all" lazy="true">
      <key column="user_id"/>
      <one-to-many
         class="DataLayer.Entities.UserSettingsEntity, NHibernateOneToMany"/>
    </bag>
    
  </class>
</hibernate-mapping>